package la.iok.hzsvn.lewin.movie.core.shopmovie.param;

import java.util.Date;
import java.util.Objects;

/**
 * 优惠券创建的参数
 * @since 1.1.1
 */
public class CouponParam {
    private Long couponDefinitionId;
    /**
     * 优惠券有效时长,以时间长度计算,单位秒；-1：永久有效,-2:当天有效,-3:本周内有效（以周日为一周最后一天);-4:本月内有效；-5：本季度内有效；-6：本年内有效
     */
    private Integer seconds;
    /**
     * 优惠券失效时间。指定具体的时间点
     */
    private Date endTime;

    public Long getCouponDefinitionId() {
        return couponDefinitionId;
    }

    public void setCouponDefinitionId(Long couponDefinitionId) {
        this.couponDefinitionId = couponDefinitionId;
    }

    public Integer getSeconds() {
        return seconds;
    }

    public void setSeconds(Integer seconds) {
        this.seconds = seconds;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CouponParam)) return false;
        CouponParam that = (CouponParam) o;
        return Objects.equals(couponDefinitionId, that.couponDefinitionId) && Objects.equals(seconds, that.seconds);
    }

    @Override
    public int hashCode() {
        return Objects.hash(couponDefinitionId, seconds);
    }

    @Override
    public String toString() {
        return "CouponParam{" +
                "couponDefinitionId=" + couponDefinitionId +
                ", seconds=" + seconds +
                '}';
    }
}
